<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@page import="org.apache.catalina.Session"%>
<%@ page import="java.sql.Date,java.sql.*"%>
<%@ page import="cn.ticket.db.DBConnect"%>
<%@ page import="cn.ticket.util.StringUtil"%>
<%@ page import="cn.ticket.Constant"%>
<%@ page import="cn.ticket.util.CommonEncryption"%>
   
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>车次列表</title>
</head>
<body>
	<jsp:include page="common/head.jsp"></jsp:include>
	<div class="content">
		<jsp:include page="common/bar_left.jsp"></jsp:include>
	<table class="table table-hover">
	<tr>
		<td>序号</td>
		<td>车次</td>
		<td>始发站</td>
		<td>终点站</td>
		<td>开车时间</td>
		<td>价格</td>
		<td></td>
		<td>操作</td>
	</tr>
<%
	request.setCharacterEncoding("utf8" ) ;
	String id = StringUtil.createUUID() ;
	Connection dbcn = new DBConnect().DBConnection() ;
	try {
		String sql = "select id,num,oriStation,desStation,time,price from ticket where id = ? " ;
		PreparedStatement pstmt =  con.prepareStatement(sql) ;
		pstmt.setString(1, ticketId) ;
		ResultSet rs = pstmt.executeQuery() ;
		if(rs.next()){
				%>
					<tr>
						<td><%=rs.getRow() %></td>
						<td><%=rs.getString(2) %></td>
						<td><%=rs.getString(3) %></td>
						<td><%=rs.getString(4) %></td>
						<td><%=rs.getString(5) %></td>
						<td><%=rs.getInt(6) %></td>
							</tr>
				<%
					}else{
						%>
			<tr>
				<td colspan="6">发生异常..</td>
			</tr>
			<%
					}
				%>				
	<%
			}catch(Exception e){
				e.printStackTrace() ;
			}
				%>
		</tr>
		</table>
		</div>
	<jsp:include page="common/footer.jsp"></jsp:include>
</body>
</html>